<%@ page language="java" import="com.siysoft.tc.base.bean.to.User"
	pageEncoding="UTF-8"%>
<script>

$("#reservation_chat_content").focus(function(){
	if($(this).val()=="Leave a message?"){
		$(this).val("");
	}
})

function _foo1(id)
{
	return function(){reservation_chat_list(id);};
}

function addClassroomRemind(reservation_id, user_id){
	$.ajax({
		type:"get",
		url:"<%=request.getContextPath()%>/app/remind/addNewRemind.htm",
		data:{
			"data_id":reservation_id,
			"user_id":user_id,
			"type":0
		},
		async:false,
		success:function(data){
		}
	})
}

function reservation_chat_list(reservation_id){

	if(($(".evaluate_pay").is(":hidden"))){
		int = window.clearInterval(int);
		return false;
	}
	//room_chat_list
	$.ajax({
		type:"get",
		url:"<%=request.getContextPath()%>/app/classroom/chat_list.htm",
		data:{
			"reservation_id":reservation_id
		},
		async:false,
		success:function(data){
			rm = data.data.roomchat;
			reservation_chat_list_html = "";
			for(var i = 0; i < rm.length; i++){
				reservation_chat_list_html = reservation_chat_list_html
				+ '<li>'
				+ '<img src="<%=request.getContextPath()%>/'
				+ rm[i].room_chat_user_avatar + '" class="photo"> '
				+ rm[i].room_chat_user_name + ': ' + rm[i].room_chat_content
				+ '<input type="hidden" id="room_chat_user_name" value="' + rm[i].room_chat_user_name + '"/>'
				+ '<span class="say reservation_chat_reply"><img src="<%=request.getContextPath()%>/common/images/say.png" width="26" height="19"></span>'
				+ '</li>';
			}
			$("#reservation_chat_list").html(reservation_chat_list_html);
			$(".reservation_chat_reply").on("click",function(){
				$("#reservation_chat_content").val("@" + $(this).prev().val() + ":");
			})
		}
	});
}
</script>